
drop table jms_dm.dm_sham_send_monitor_detail_dt
;

CREATE TABLE jms_dm.dm_sham_send_monitor_detail_dt
(
bill_code varchar(200) comment '运单编号',
network_code varchar(200) comment '首责任网点code',
taking_time datetime comment '揽收时间',
input_time varchar(200) comment '运单录入时间',
network_name varchar(200) comment '首责任网点名称',
network_type varchar(200) comment '首责任网点类型',
agent_code varchar(200) comment '首责任机构所属代理区code',
agent_name varchar(200) comment '首责任机构所属代理区',
fst_duty_type varchar(200) comment '首责任类型',
fst_duty_standard varchar(200) comment '首责任标准',
start_network_code varchar(200) comment '始发网点code',
start_network_name varchar(200) comment '始发网点名称',
start_agent_code varchar(200) comment '始发代理区code',
start_agent_name varchar(200) comment '始发代理区',
start_city_id varchar(200) comment '始发城市id',
start_city_desc varchar(200) comment '始发城市',
start_provider_id varchar(200) comment '始发省份id',
start_provider_desc varchar(200) comment '始发省份',
destination_network_code varchar(200) comment '目的网点code',
destination_network_name varchar(200) comment '目的网点',
destination_agent_code varchar(200) comment '目的代理区code',
destination_agent_name varchar(200) comment '目的代理区',
destination_city_id varchar(200) comment '目的城市id',
destination_city_desc varchar(200) comment '目的城市',
destination_provider_id varchar(200) comment '目的省份id',
destination_provider_desc varchar(200) comment '目的省份',
line_link_code varchar(500) comment '链路环节code',
line_link_name varchar(500) comment '链路环节',
duty_org_code varchar(200) comment '责任机构code',
duty_org_name varchar(200) comment '责任机构',
duration_hour varchar(200)  comment '时长',
deliver_network_code varchar(200) comment '出仓网点code',
deliver_network_name varchar(200) comment '出仓网点',
deliver_city_id varchar(200) comment '出仓网点所属城市id',
deliver_city_desc varchar(200) comment '出仓网点所属城市',
deliver_provider_id varchar(200) comment '出仓网点所属省份id',
deliver_provider_desc varchar(200) comment '出仓网点所属省份',
sign_time varchar(200) comment '签收时间',
is_reback varchar(200) comment '是否退件'
) ENGINE=OLAP
DUPLICATE KEY(`bill_code`, `network_code`, `taking_time`)
COMMENT "虚假发货监控-明细表"
PARTITION BY RANGE(`taking_time`)
(START ('2023-07-01') END ('2023-09-30') EVERY (INTERVAL 1 day) )
DISTRIBUTED BY HASH(`network_code`) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);